package com.example.shiyansan.handler;


import com.example.shiyansan.result.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionHandler {

    /**
     *捕获业务异常
     */
    @ExceptionHandler
    public Result exceptionHandler(Exception exception){
        return Result.error(exception.getMessage());
    }
}
